﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZyGames.Framework.Model;

namespace ZyGames.DZPocker.Model
{
	/// <summary>
	/// 玩家的手牌
	/// </summary>
	[Serializable, ProtoContract]
	[EntityTable(CacheType.Dictionary, DbConfig.Data)]
	public class GameTableUserHandCards : BaseEntity
	{
		public GameTableUserHandCards()
			: base(false)
		{
		}
		public GameTableUserHandCards(int id, int savedUserId, int tableId, int userId, string userHeadIcon, string userNickName, int card0, int card1)
			: this()
		{
			this.ID = id;
			this.SavedUserID = savedUserId;
			this.TableID = tableId;
			this.UserID = userId;
			this.UserHeadIcon = userHeadIcon;
			this.UserNickName = userNickName;
			this.Card0 = card0;
			this.Card1 = card1;
		}

		[ProtoMember(1)]
		[EntityField(true)]
		public int ID { get; set; }

		/// <summary>
		/// 保存的玩家ID
		/// </summary>
		[ProtoMember(2)]
		[EntityField]
		public int SavedUserID { get; set; }

		/// <summary>
		/// 桌子的逻辑ID
		/// </summary>        
		[ProtoMember(3)]
		[EntityField]
		public int TableID { get; set; }

		/// <summary>
		/// 当前是第几手牌局
		/// </summary>        
		[ProtoMember(4)]
		[EntityField]
		public int Hand { get; set; }

		[ProtoMember(5)]
		[EntityField]
		public int UserID { get; set; }

		[ProtoMember(6)]
		[EntityField]
		public string UserHeadIcon { get; set; }

		/// <summary>
		/// 桌子ID
		/// </summary>        
		[ProtoMember(7)]
		[EntityField]
		public string UserNickName { get; set; }

		/// <summary>
		/// 手牌0
		/// </summary>        
		[ProtoMember(8)]
		[EntityField]
		public int Card0 { get; set; }

		/// <summary>
		/// 手牌1
		/// </summary>        
		[ProtoMember(9)]
		[EntityField]
		public int Card1 { get; set; }

		/// <summary>
		/// 当前一首输赢的筹码数量
		/// </summary>
		[ProtoMember(10)]
		[EntityField]
		public int WinChip { get; set; }

		protected override int GetIdentityId()
		{
			return ID;
		}
	}
}
